//
//  ImageEffect.m
//  WaterStreet
//
//  Created by 재효 조 on 12. 2. 13..
//  Copyright (c) 2012년 가족. All rights reserved.
//

#import "ImageEffect.h"

@implementation ImageEffect

-(UIImage *) convertBlackAndWhite:(UIImage *)original
{
    CGRect imageRect = CGRectMake(0, 0, original.size.width, original.size.height);
    
    CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceGray();
    
    CGContextRef context = CGBitmapContextCreate(nil, original.size.width, original.size.height, 8, 0, colorSpace, kCGImageAlphaNone);
    
    CGContextDrawImage(context, imageRect, [original CGImage]);
    
    return [UIImage imageWithCGImage:CGBitmapContextCreateImage(context)];
}

@end
